<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录</title>
    <style>
        nav {
            display: flex;
            background: #f3f3f3;
            line-height: 2;
            justify-content: space-around;
            font-size: 18px;
        }

        .loginNav {
            display: flex;
            background: #f3f3f3;
            line-height: 2;
            justify-content: space-around;
            font-size: 18px;
        }

        /* .bodyDiv {
            max-width: 1000px;
            margin: 0 auto;
        } */


        body {
            /* 可以去除导航栏顶部的间隙 */
            margin: 0;
            /* background-image: url("https://p.ssl.qhimg.com/sdm/633_417_/t0111ac7b662effbfa1.jpg"); */
            background-image: url("../Resources/qiwutuanbackground.jpeg");
            background-repeat: no-repeat;
            background-size: 100%;
        }

        @media screen and (max-width: 480px) {
            nav {
                flex-direction: column;
            }
        }

        .loginDiv {
            margin-left: 62%;
            margin-top: 15%;
            padding: 20px;
            height: 150px;
            color: black;
            background-color: white;
            width: 280px;
            border-radius: 25px;
        }

        p span {
            display: inline-block;
            width: 80px;
            text-align: right;
        }

        .submitButton {
            background-color: rgb(0, 181, 108);
            color: white;
            width: 200px;
            height: 40px;
            /* 取出按钮显示的灰色边框 */
            border: none;
            /* 去除选中的时候的边框 */
            outline: none;
            border-radius: 20px;
            /* position: absolute; left:100px; */
            position: relative;
            left: 50px;
        }

        /* 注册输入框部分错误提示 */
        .error {
            color: red;
        }

        input.error {
            border-color: red;
        }
    </style>
</head>

<body>
    <div class="bodyDiv">

        <nav class="nav">
            登录
        </nav>

        <div class="loginDiv">
            <form>
                <p><span>
                        用户名：
                    </span>
                    <input type="text" placeholder="请输入要用户名/手机号" id="accountNameMobileNumber">
                </p>

                <p><span>
                        密码：
                    </span>
                    <input type="password" , placeholder="请输入密码" , required id="password">
                </p>

            </form>

            <!-- onsubmit="registerFunction()" -->
            <input type="submit" , value="登录" class="submitButton" onclick="loginFunction()">
        </div>
    </div>

</body>


<script>
    function loginFunction() {

        // 获取手机号 密码 用户名 短信验证码
        let accountName = getElementValue("accountNameMobileNumber");
        let password = getElementValue("password");

        // 校验输入内容
        if (!accountName) {
            alert("请输入用户名");
            return;
        }
        if (!password) {
            alert("请设置密码");
            return;
        }
        // window.open("./qiSupplyInfo.html", "", "_self");
        window.location.href = "./qiSupplyInfo.html";

        // alert(password);
        // alert(accountName);
    }

    // 获取对应 id 的值
    function getElementValue(name) {
        return document.getElementById(name).value;
    }
</script>

</html>